<?php

header("content-type:text/html;charset=utf-8");
 include "../config/mysql.php";
 session_start();
 if(isset($_SESSION['username'])){
 

$explanation=$_POST["content"];
$king=$_POST["king"];
// echo $kid;
// echo $content;
// echo $king;

 $tr=$pdo->exec("insert into article_kind (king,explanation) values ('$king','$explanation')");
 //var_dump("insert into article_kind (king,kid.explanation) values ('$king','$kid','$explanation')");

 
 if($tr){
                 	header("refresh:1;url=../index.php");
                 	print("添加分类成功,请稍后..<br>");
                 }
                 else{
                 	header("refresh:10;url=../addkid.php?id=$id");
                 	print("添加分类失败,请稍后..<br>");
                 }

}else{
	header("Location:../log.php");
      exit();
}
?>